<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>hasPrototypeObject</title>
</head>

<body>
    <div>打开控制台查看结果</div>
    <script>
        const hasPrototypeObject = (obj, name) => !obj.hasOwnProperty(name) && (name in obj);
        function Person() { }
        Person.prototype.name = "夕水";
        let person = new Person();
        console.log(hasPrototypeObject(person, 'name'));//true
    </script>
</body>

</html>